<ti-table [srcData]="srcData" [(displayedData)]="displayedData">
  <table>
    <thead>
      <tr>
        <th *ngFor="let column of columns">{{column.title}}</th>
      </tr>
    </thead>
    <tbody>
      <ng-container *ngFor="let row of displayedData;trackBy: trackByFn">
        <tr *ngIf="editingRow?.id !== row.id else editingTemplate">
          <td>{{row.sourceName}}</td>
          <td>{{row.level}}</td>
          <td>{{row.unsubscribe}}</td>
          <td>{{row.createTime| date: "yyyy-MM-dd"}}</td>
          <td>
            <ti-actionmenu (select)="onSelect($event, row)" [items]="items"></ti-actionmenu>
          </td>
        </tr>
        <ng-template #editingTemplate>
          <tr>
            <td>{{row.sourceName}}</td>
            <td>
              <ti-select [options]="levelOptions" [(ngModel)]="editingRow.level" valueKey="label"></ti-select>
            </td>
            <td>
              <input type="text" tiText [(ngModel)]="editingRow.unsubscribe" />
            </td>
            <td>
              <ti-date [(ngModel)]="editingRow.createTime"></ti-date>
            </td>
            <td>
              <ti-actionmenu [items]="editingItems" (select)="onSelectEditing($event, row)"></ti-actionmenu>
            </td>
          </tr>
        </ng-template>
      </ng-container>
    </tbody>
  </table>
</ti-table>
